package picounit.misc;

import moved.org.objectweb.asm.Opcodes;

import java.util.HashMap;
import java.util.Map;

public class OpcodeLookup {
	private final Map<Object, String> lookup = new HashMap<Object, String>();
	
	public static void main(String[] args) {
		new OpcodeLookup();
	}
	
	public OpcodeLookup() {
		lookup.put(Opcodes.NOP, "NOP");
		lookup.put(Opcodes.ACONST_NULL, "ACONST_NULL");
		lookup.put(Opcodes.ICONST_M1, "ICONST_M1");
		lookup.put(Opcodes.ICONST_0, "ICONST_0");
		lookup.put(Opcodes.ICONST_1, "ICONST_1");
		lookup.put(Opcodes.ICONST_2, "ICONST_2");
		lookup.put(Opcodes.ICONST_3, "ICONST_3");
		lookup.put(Opcodes.ICONST_4, "ICONST_4");
		lookup.put(Opcodes.ICONST_5, "ICONST_5");
		lookup.put(Opcodes.LCONST_0, "LCONST_0");
		lookup.put(Opcodes.LCONST_1, "LCONST_1");
		lookup.put(Opcodes.FCONST_0, "FCONST_0");
		lookup.put(Opcodes.FCONST_1, "FCONST_1");
		lookup.put(Opcodes.FCONST_2, "FCONST_2");
		lookup.put(Opcodes.DCONST_0, "DCONST_0");
		lookup.put(Opcodes.DCONST_1, "DCONST_1");
		lookup.put(Opcodes.BIPUSH, "BIPUSH");
		lookup.put(Opcodes.SIPUSH, "SIPUSH");
		lookup.put(Opcodes.LDC, "LDC");
		lookup.put(Opcodes.ILOAD, "ILOAD");
		lookup.put(Opcodes.LLOAD, "LLOAD");
		lookup.put(Opcodes.FLOAD, "FLOAD");
		lookup.put(Opcodes.DLOAD, "DLOAD");
		lookup.put(Opcodes.ALOAD, "ALOAD");
		lookup.put(Opcodes.IALOAD, "IALOAD");
		lookup.put(Opcodes.LALOAD, "LALOAD");
		lookup.put(Opcodes.FALOAD, "FALOAD");
		lookup.put(Opcodes.DALOAD, "DALOAD");
		lookup.put(Opcodes.AALOAD, "AALOAD");
		lookup.put(Opcodes.BALOAD, "BALOAD");
		lookup.put(Opcodes.CALOAD, "CALOAD");
		lookup.put(Opcodes.SALOAD, "SALOAD");
		lookup.put(Opcodes.ISTORE, "ISTORE");
		lookup.put(Opcodes.LSTORE, "LSTORE");
		lookup.put(Opcodes.FSTORE, "FSTORE");
		lookup.put(Opcodes.DSTORE, "DSTORE");
		lookup.put(Opcodes.ASTORE, "ASTORE");
		lookup.put(Opcodes.IASTORE, "IASTORE");
		lookup.put(Opcodes.LASTORE, "LASTORE");
		lookup.put(Opcodes.FASTORE, "FASTORE");
		lookup.put(Opcodes.DASTORE, "DASTORE");
		lookup.put(Opcodes.AASTORE, "AASTORE");
		lookup.put(Opcodes.BASTORE, "BASTORE");
		lookup.put(Opcodes.CASTORE, "CASTORE");
		lookup.put(Opcodes.SASTORE, "SASTORE");
		lookup.put(Opcodes.POP, "POP");
		lookup.put(Opcodes.POP2, "POP2");
		lookup.put(Opcodes.DUP, "DUP");
		lookup.put(Opcodes.DUP_X1, "DUP_X1");
		lookup.put(Opcodes.DUP_X2, "DUP_X2");
		lookup.put(Opcodes.DUP2, "DUP2");
		lookup.put(Opcodes.DUP2_X1, "DUP2_X1");
		lookup.put(Opcodes.DUP2_X2, "DUP2_X2");
		lookup.put(Opcodes.SWAP, "SWAP");
		lookup.put(Opcodes.IADD, "IADD");
		lookup.put(Opcodes.LADD, "LADD");
		lookup.put(Opcodes.FADD, "FADD");
		lookup.put(Opcodes.DADD, "DADD");
		lookup.put(Opcodes.ISUB, "ISUB");
		lookup.put(Opcodes.LSUB, "LSUB");
		lookup.put(Opcodes.FSUB, "FSUB");
		lookup.put(Opcodes.DSUB, "DSUB");
		lookup.put(Opcodes.IMUL, "IMUL");
		lookup.put(Opcodes.LMUL, "LMUL");
		lookup.put(Opcodes.FMUL, "FMUL");
		lookup.put(Opcodes.DMUL, "DMUL");
		lookup.put(Opcodes.IDIV, "IDIV");
		lookup.put(Opcodes.LDIV, "LDIV");
		lookup.put(Opcodes.FDIV, "FDIV");
		lookup.put(Opcodes.DDIV, "DDIV");
		lookup.put(Opcodes.IREM, "IREM");
		lookup.put(Opcodes.LREM, "LREM");
		lookup.put(Opcodes.FREM, "FREM");
		lookup.put(Opcodes.DREM, "DREM");
		lookup.put(Opcodes.INEG, "INEG");
		lookup.put(Opcodes.LNEG, "LNEG");
		lookup.put(Opcodes.FNEG, "FNEG");
		lookup.put(Opcodes.DNEG, "DNEG");
		lookup.put(Opcodes.ISHL, "ISHL");
		lookup.put(Opcodes.LSHL, "LSHL");
		lookup.put(Opcodes.ISHR, "ISHR");
		lookup.put(Opcodes.LSHR, "LSHR");
		lookup.put(Opcodes.IUSHR, "IUSHR");
		lookup.put(Opcodes.LUSHR, "LUSHR");
		lookup.put(Opcodes.IAND, "IAND");
		lookup.put(Opcodes.LAND, "LAND");
		lookup.put(Opcodes.IOR, "IOR");
		lookup.put(Opcodes.LOR, "LOR");
		lookup.put(Opcodes.IXOR, "IXOR");
		lookup.put(Opcodes.LXOR, "LXOR");
		lookup.put(Opcodes.IINC, "IINC");
		lookup.put(Opcodes.I2L, "I2L");
		lookup.put(Opcodes.I2F, "I2F");
		lookup.put(Opcodes.I2D, "I2D");
		lookup.put(Opcodes.L2I, "L2I");
		lookup.put(Opcodes.L2F, "L2F");
		lookup.put(Opcodes.L2D, "L2D");
		lookup.put(Opcodes.F2I, "F2I");
		lookup.put(Opcodes.F2L, "F2L");
		lookup.put(Opcodes.F2D, "F2D");
		lookup.put(Opcodes.D2I, "D2I");
		lookup.put(Opcodes.D2L, "D2L");
		lookup.put(Opcodes.D2F, "D2F");
		lookup.put(Opcodes.I2B, "I2B");
		lookup.put(Opcodes.I2C, "I2C");
		lookup.put(Opcodes.I2S, "I2S");
		lookup.put(Opcodes.LCMP, "LCMP");
		lookup.put(Opcodes.FCMPL, "FCMPL");
		lookup.put(Opcodes.FCMPG, "FCMPG");
		lookup.put(Opcodes.DCMPL, "DCMPL");
		lookup.put(Opcodes.DCMPG, "DCMPG");
		lookup.put(Opcodes.IFEQ, "IFEQ");
		lookup.put(Opcodes.IFNE, "IFNE");
		lookup.put(Opcodes.IFLT, "IFLT");
		lookup.put(Opcodes.IFGE, "IFGE");
		lookup.put(Opcodes.IFGT, "IFGT");
		lookup.put(Opcodes.IFLE, "IFLE");
		lookup.put(Opcodes.IF_ICMPEQ, "IF_ICMPEQ");
		lookup.put(Opcodes.IF_ICMPNE, "IF_ICMPNE");
		lookup.put(Opcodes.IF_ICMPLT, "IF_ICMPLT");
		lookup.put(Opcodes.IF_ICMPGE, "IF_ICMPGE");
		lookup.put(Opcodes.IF_ICMPGT, "IF_ICMPGT");
		lookup.put(Opcodes.IF_ICMPLE, "IF_ICMPLE");
		lookup.put(Opcodes.IF_ACMPEQ, "IF_ACMPEQ");
		lookup.put(Opcodes.IF_ACMPNE, "IF_ACMPNE");
		lookup.put(Opcodes.GOTO, "GOTO");
		lookup.put(Opcodes.JSR, "JSR");
		lookup.put(Opcodes.RET, "RET");
		lookup.put(Opcodes.TABLESWITCH, "TABLESWITCH");
		lookup.put(Opcodes.LOOKUPSWITCH, "LOOKUPSWITCH");
		lookup.put(Opcodes.IRETURN, "IRETURN");
		lookup.put(Opcodes.LRETURN, "LRETURN");
		lookup.put(Opcodes.FRETURN, "FRETURN");
		lookup.put(Opcodes.DRETURN, "DRETURN");
		lookup.put(Opcodes.ARETURN, "ARETURN");
		lookup.put(Opcodes.RETURN, "RETURN");
		lookup.put(Opcodes.GETSTATIC, "GETSTATIC");
		lookup.put(Opcodes.PUTSTATIC, "PUTSTATIC");
		lookup.put(Opcodes.GETFIELD, "GETFIELD");
		lookup.put(Opcodes.PUTFIELD, "PUTFIELD");
		lookup.put(Opcodes.INVOKEVIRTUAL, "INVOKEVIRTUAL");
		lookup.put(Opcodes.INVOKESPECIAL, "INVOKESPECIAL");
		lookup.put(Opcodes.INVOKESTATIC, "INVOKESTATIC");
		lookup.put(Opcodes.INVOKEINTERFACE, "INVOKEINTERFACE");
		lookup.put(Opcodes.NEW, "NEW");
		lookup.put(Opcodes.NEWARRAY, "NEWARRAY");
		lookup.put(Opcodes.ANEWARRAY, "ANEWARRAY");
		lookup.put(Opcodes.ARRAYLENGTH, "ARRAYLENGTH");
		lookup.put(Opcodes.ATHROW, "ATHROW");
		lookup.put(Opcodes.CHECKCAST, "CHECKCAST");
		lookup.put(Opcodes.INSTANCEOF, "INSTANCEOF");
		lookup.put(Opcodes.MONITORENTER, "MONITORENTER");
		lookup.put(Opcodes.MONITOREXIT, "MONITOREXIT");
		lookup.put(Opcodes.MULTIANEWARRAY, "MULTIANEWARRAY");
		lookup.put(Opcodes.IFNULL, "IFNULL");
		lookup.put(Opcodes.IFNONNULL, "IFNONNULL");
	}
	
	public String lookup(Object opcode) {
		return lookup.get(opcode);
	}
}
